<?php
if (!defined('BASEPATH'))
    exit('No direct script access allowed');
class Home extends MY_Controller {
    /**
    * Responsable for auto load the model
    * @return void
    */
   public function __construct(){
		parent::__construct();
		$this->load->model('users_m', 'users');
		$this->load->model('canhan_m', 'canhan');				
		$this->load->helper('util');		
   }
	
	function index(){		 
 		$data = array();
		//foreach($this->dichvu->get_dichvu() as $obj)
			// echo sanitize_title_with_dashes(remove_accents($obj->ten)).'<br/>';
		// die;
		$data['pg_tiec']	= $this->canhan->get_newest_pg_tiec(array(
			'limit'		=>	12,
			'order_by'	=>	'cn.ngay_cap_nhat',
			'order'		=>	'DESC'
		));
		$tmp = array(
				'limit'		=>	30,
				'paged'		=>	0
			);
		$this->load->model('tuyendung_m', 'tuyendung');
		$data['tin_td']		= $this->tuyendung->get_tin_tuyen_dung($tmp);
		// echo $this->db->last_query();die;
		// $data['pg_tour']	= $this->canhan->get_newest_pg_tour(array(
			// 'limit'		=>	8,
			// 'order_by'	=>	'cn.ngay_cap_nhat',
			// 'order'		=>	'DESC'			
		// ));		
		
		// $data['hoso']		= $this->canhan->get_newest_hoso(array(
			// 'limit'		=>	8,
			// 'order_by'	=>	'cn.ngay_cap_nhat',
			// 'order'		=>	'DESC'
		// ));
		
		#echo $this->db->last_query();die;
		$data['title'] 	= 'Dịch vụ PG Tiệc - PG Tour';
		$data['content'] 	= 'home';		
		$this->load->model('help_m', 'help');
		$data['helps'][] 	= array(
			'title'	=>	'FAQs',
			'help'	=>	$this->help->get_helps('page'));
		$data['helps'][] 	= array(
			'title'	=>	'Hướng dẫn đăng ký',
			'help'	=>	$this->help->get_helps('dang_ky'));
		$data['quangcao'] = 'tpl/quangcao';
		$this->load->view('tpl/template', $data);
	}
 }